/**
 * @name: frontPageService
 * @Description:
 * @Author: 方琦
 * @Date: 2022/6/17 9:34
 **/
import axios from "@/utils/axios";
import api from "@/api";

export default {
    badReactList,//获取不良反应列表
    cancelMyDoctor,//取消绑定的医生
    myDoctorMsg,//获取我绑定的医生信息
    onsetNo,//发作次数(否)
    onsetYes,//发作次数（是）
    insertBadReact,//记录不良反应
    doctorList,//查询所有医生
    bindDoctor,//绑定医生
    patientActivities,//患教活动列表
    recortCount,//获取最新的发作次数
}
function badReactList(){
    return axios({
        url:api.frontPageApi.badReactList,
        method:'get'
    })
}
function cancelMyDoctor(id) {
    return axios({
        url: api.frontPageApi.cancelMyDoctor,
        method: 'post',
        params: {id}
    })
}

function myDoctorMsg(id) {
    return axios({
        url: api.frontPageApi.myDoctorMsg,
        method: 'post',
        params: {
            id
        }
    })
}

function recortCount(Phone) {
    return axios({
        url: api.frontPageApi.recortCount,
        method: 'get',
        params: {
            Phone
        }
    })
}

function patientActivities(phone) {
    return axios({
        url: api.frontPageApi.patientActivities,
        method: 'post',
        params: {phone}
    })
}

function bindDoctor(id, phone) {
    return axios({
        url: api.frontPageApi.bindDoctor,
        method: 'POST',
        params: {id, phone}
    })
}

function doctorList() {
    return axios({
        url: api.frontPageApi.doctorList,
        method: 'POST'
    })
}

function insertBadReact(Phone,badReactList1) {
    return axios({
        url: api.frontPageApi.insertBadReact,
        method: 'post',
        params: {Phone,badReactList1}
    })
}

function onsetNo(Phone) {
    return axios({
        url: api.frontPageApi.onsetNo,
        method: "get",
        params:{
            Phone
        }
    })
}

function onsetYes(Phone,reactNumber) {
    return axios({
        url: api.frontPageApi.onsetYes,
        method: 'get',
        params: {
            Phone,reactNumber
        }
    })
}
